<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="fck" %>
<%@page import="java.util.*,model.*,util.*,control.*"%>
<!DOCTYPE html>
<html>
<head>
    <title>自适应测评系统</title>
    <meta charset="utf-8"/>
    <script  src='../../js/core.js'></script>
    <script  src='../../js/jquery-1.4.2.js'></script>
    <script  src='../../js/rows.js'></script>
    <link type="text/css" rel='stylesheet' href="../../css/common.css"/>
    <link type="text/css" rel='stylesheet' href="../../css/houtai.css"/>
</head>
           <%
           /***********************************************************************************/
           /*
           *验证权限
           *author 胡瑾
           *data 2011-12-08
           */
			String flag = (String)session.getAttribute("flag");
			String userId = (String)session.getAttribute("userId");
			int adminId = Integer.parseInt(userId);
						
			if (flag != "admin"|| flag == null )
			{
				%>
      <script language="javascript">
				     alert("您没有管理员权限,请重新登录");
				     window.location.href="../../index.jsp";
				    </script>
      <%
				
			}else{
				Admin admin = new Admin();
				AdminControl ac = new AdminControl();
				admin = ac.GetAdmin(adminId);
				//out.print("<p>"+admin.getName()+"   欢迎您</p>");
				
			}
			/*********************************************************************************/
           %>
<body>
<%
	request.setCharacterEncoding("utf-8");
	int pages = ParamUtil.getInt(request,"pages",1);
	int rowsPerPage = ParamUtil.getInt(request,"pageSize",20);
	String studentId_str = ParamUtil.getString(request,"studentId");
	int studentId = Integer.parseInt(studentId_str);
	Answerlog answerlog = new Answerlog();
	AnswerlogControl alc = new AnswerlogControl();
%>
<form method="post">
        <table class='main' width='98%'>
        <thead>
          <tr>
            <td>情况序号</td>
            <td>学号</td>
            <td>试题编号</td>
            <td>答题时间</td>
            <td>答对为1,答错为0</td>
          </tr>
         </thead>
          <%
			List<Answerlog>list = new ArrayList<Answerlog>();
			list = (List)alc.GetAnswerlog(pages,rowsPerPage);
			int k=0;
			for(int i = 0; i<list.size();i++)
			{
				answerlog = list.get(i);
				if(answerlog.getStudentId()== studentId){
				k++;
				//System.out.println(answerlog.getAnswerlogId());
			%>
			<tbody>
          <tr >
            <td><%=answerlog.getAnswerlogId() %></td>
            <td><%=answerlog.getStudentId()%></td>
            <td><%=answerlog.getId() %></td>
            <td><%=answerlog.getAwTime() %></td>
            <td><%=answerlog.getFlag() %></td>
          </tr>
          <%
			}
		}
		 %>
		 </tbody>
        </table>
        <p style='margin-left: 20px;'>
        <%
		out.println(AnswerlogControl.pageInstance.getToolsMenu(pages));
		%>
        </p>
    </form>
</body>
</html>
